package exception;

public class TryCatchDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了");

        try {


            String s1 = "";
            System.out.println(s1.charAt(0));
            String s2 = "abc";
            System.out.println(Integer.parseInt(s2));

        } catch (NullPointerException e) {
            System.out.println("异常被处理了");
        } catch (StringIndexOutOfBoundsException e) {
            System.out.println("解决了");
        } catch (Exception e) {
            System.out.println("反正就是异常了");
        }

        System.out.println("程序结束了");


    }
}
